﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ObjTwinking : MonoBehaviour {

    private float caltime;
    private Renderer renderor;

    // Use this for initialization
    void Start()
    {
        caltime = 0f;
        renderor = this.gameObject.GetComponent<Renderer>();
    }

    // Update is called once per frame
    void Update()
    {
        caltime += Time.deltaTime;
        if (caltime % 0.5 > 0.25)
        {
            renderor.material.color = new Color(renderor.material.color.r, renderor.material.color.g, renderor.material.color.b, 0f);
        }
        else
        {
            renderor.material.color = new Color(renderor.material.color.r, renderor.material.color.g, renderor.material.color.b, 1f);
        }
    }
}
